<?php
// 处理字符串防止特殊符号引起的错误，
$process_include    = array('cname', 'url');
string_pre_process($record, $process_include);
// extract($record, EXTR_OVERWRITE);

// 取得返回字符串
$back_url   = strcode(getcookie('back_url'), 'DECODE');
if($back_url == '') $back_url   = $mod_url['c.li'];


$record['order_no'] = $record['order_no'] > 0 && $record['order_no'] < $G_big_integer ?
        @(int)$record['order_no'] : '';


if($record['img'] == '' ) {
    $img_preview = $url_global['common'] . '/images/nopic.jpg';
} else {
    $abs    = realpath($G_abs_upload . '/' . $record['img']);
    if($abs && ! is_dir($abs)) {
        $img_preview = $G_web_upload . '/' . $record['img'];
    } else {
        $img_preview = $url_global['common'] . '/images/nopic.jpg';
    }
}


if($action == 'c.modify') {
    $txt_form_title = "修改内容分类";
    if($record['redirect'] == 1) {
        $chk_redirect = ' checked';
        $style_url      = 'display:block;';
    } else {
        $chk_redirect   = '';
        $style_url      = 'display:none;';
    }
} else {
    $txt_form_title = "新增内容分类";
    $chk_redirect   = '';
    $style_url      = 'display:none;';
}



require($abs_admin_cppath . '/header.php');
?>

<div class="datacontainer2" style="width:600px">
<form action="<?php echo $mod_url['save']; ?>" name="form_save" method="post" enctype="multipart/form-data">
<div class="header"><?php echo $txt_form_title; ?></div>
<TABLE border="0" cellpadding="0" cellspacing="0" width="90%" class="list_table">
<TR>
	<TD width="80" class="caption">上级分类</TD>
	<TD class="cell">
		<select name="class[pid]" class="select">
			<!-- <option value="0">根分类</option> -->
			<?php echo get_tree_node($cata, $$class_var, $record['pid'],0,1); ?>
		</select></TD>
</TR>
<TR>
	<TD width="80" class="caption">分类名称</TD>
	<TD class="cell"><INPUT TYPE="text" NAME="class[cname]" value="<?php echo $record['cname']; ?>" class="text" size="30">
	
	</TD>
</TR>

<TR>
	<TD width="80" class="caption">分类排序</TD>
	<TD class="cell"><INPUT TYPE="text" NAME="class[order_no]" value="<?php echo $record['order_no']; ?>" class="text textr" size="8"
	onkeypress="return non_num_filter(this);">
	<div class="hint">
	该项排序用于同级分类的显示顺序调整。数字越小越靠前，序号“1”为最前，序号相同的分类按录入先后顺序排列，未显式指定序号的分类在末尾按录入先后顺序排列。
	</div>
	</TD>
</TR>

<TR>
	<TD width="80" align="right" class="caption">SEO</TD>
	<TD class="cell">
<TABLE border="0" cellpadding="2" cellspacing="2" width="90%" class="non_border">
<TR>
    <TD width="80" align="right">title：</TD>
    <TD><input type="text" name="class[seo_title]" value="<?php echo $record['seo_title']; ?>" class="text width90pc" Require="false" dataType="Limit" max="255" msg="页面自定义title不能超过255个字符">
    <div class="hint">如无特殊需要，请不要填写该分类的title，系统会将页面自动默认为分类名称。</div></TD>
</TR>
<TR>
    <TD width="80" align="right">keywords：</TD>
    <TD><input type="text" name="class[seo_keywords]" value="<?php echo $record['seo_keywords']; ?>" class="text width90pc" Require="false" dataType="Limit" max="255" msg="keywords不能超过255个字符"></TD>
</TR>
<TR>
    <TD width="80" align="right">description：</TD>
    <TD><input type="text" name="class[seo_description]" value="<?php echo $record['seo_description']; ?>" class="text width90pc" Require="false" dataType="Limit" max="255" msg="description不能超过255个字符"></TD>
</TR>
</TABLE>
	</TD>
</TR>
<TR>
	<TD width="80" class="caption">分类备注</TD>
	<TD class="cell"><TEXTAREA NAME="class[description]" ROWS="5" COLS="50" class="area w90"><?php echo $record['description']; ?></TEXTAREA></TD>
</TR>
</TABLE>


	<div class="submit">
		<INPUT TYPE="hidden" name="save" value="<?php echo $save_flag; ?>">
		<INPUT TYPE="hidden" name="class[cid]" value="<?php echo $record['cid']; ?>">
		<INPUT TYPE="hidden" name="class[cata_id]" value="<?php echo $cata; ?>">
		<INPUT TYPE="submit" class="btn" value=" 保存 ">
		<INPUT TYPE="reset" class="btn" value=" 重置 ">
		<INPUT TYPE="button" class="btn" value=" 返回 " onclick="location.href='<?php echo $back_url; ?>'">
	</div>

</form>
</div>


<?php
require($abs_admin_cppath . '/footer.php');
?>